// JavaScript Documentvar objReq = createRequestObject();
var objReq = createRequestObject();
var requestTo = "";

function createRequestObject(){
	
	var obj = false;
	if(window.XMLHttpRequest){
		obj = new XMLHttpRequest();
	}else if(window.ActiveXObject){
		obj = new ActiveXObject("Microsoft.XMLHTTP");
	}
	return obj;
}

function retrive(){
	
	if(objReq){
		objReq.open("GET",url);
		objReq.onreadystatechange = handleResponse;
		objReq.send(null);
	}
	
}

function handleResponse(){

	var Div = document.getElementById(targetDiv);
	if(objReq.readyState==4 && objReq.status ==200){
		return objReq.responseText;
	}
}

function api(url){
	
	requestTo=url;
	retrive();
}

